<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>系统管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<style>
	a{ text-decoration: none;}
</style>
<script type="text/javascript">
	// 使用js控制全选和撤选
	function checkAll(sysids, allSysid){
		if(sysids.length > 0){
			for(var i = 0; i < sysids.length; i++){
				sysids[i].checked = true;
			}
			if(allSysid.checked == false){
				for(var i = 0; i < sysids.length; i++){
					sysids[i].checked = false;
				}
			}
		}else{
			sysids.checked = true;
			if(allSysid.checked == false)
				sysids.checked = false;
		}
	}
	
	//检查当全部选中之后自动勾选全选按钮
	function checkOne(sysids,allSysid){
		if(sysids.length > 0){
			for(var i = 0; i < sysids.length; i++){
				if(sysids[i].checked == false)
					return;
			}
			allSysid.checked = true;
		}
	}
</script>
</head>

<body>
	系统管理>>岗位管理
    <h4>系统管理页面列表</h4>
    <form action="addJobFunc.action" method="post">
    	<input name="jobId" type="hidden" value="<s:property value="jobId"/>">
    	<table align="center" width="40%" >
        	<tr>
            	<td colspan="2"><input type="checkbox" id="allSysid"  name="all" onclick="checkAll(this.form.sysid, this.form.allSysid)"  />全选/撤选</td>
            </tr>
            <tr bgcolor="#CCCCCC">
            	<td>选择</td>
                <td>页面名称</td>
            </tr>
            <s:iterator value="sysList">
            	<s:if test="id in #session.jobFuncListSB">
            		<tr bgcolor="#CCCCCC">
						<td><input name="sysIDListA" checked="checked" type="checkbox" onclick="checkOne(this.form.sysid, this.form.allSysid)" value="<s:property value="id"/>" /></td>
						<td><s:property value="name" /></td>
           			</tr>
            	</s:if>
            	<s:else>
            		<tr bgcolor="#CCCCCC">
						<td><input name="sysIDListA" type="checkbox" onclick="checkOne(this.form.sysid, this.form.allSysid)" value="<s:property value="id"/>" /></td>
						<td><s:property value="name" /></td>
           			</tr>
            	</s:else>
           	</s:iterator>
        </table>
        <h4 align="center"><input type="submit" name="submit" value="提交" /><input type="button" name="back" value="返回" onclick="location.href='findAllJob.action'"/></h4>
    </form>
</body>
</html>
